Project

General

Profile

Actions

Feature #2728

closed

API: POST /api/hostgroups does not accept ancestry

Added by Kal Aeolian over 11 years ago. Updated over 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
trivial
Triaged:
Fixed in Releases:
Found in Releases:

Description

When trying to use the API to create hostgroups, POST /api/hostgroups does not accept a hostgroup[ancestry] as a parameter. This means a user cannot create nested hostgroups through the API.

The example json in the documentation for the API shows both hostgroup[ancestry] and hostgroup[parameters] being accepted on a post, but in the parameters below the example, neither of these are listed and indeed this is reflected in code at app/controllers/api/v1/hostgroups_controller.rb. PUT /api/hostgroups does not accept either of these fields either.

This greatly limits the usability of either of these routes unless you want to create un-nested host groups.

Actions #1

Updated by Joseph Magen over 11 years ago

  • Status changed from New to Assigned
  • Assignee set to Joseph Magen
Actions #2

Updated by Joseph Magen over 11 years ago

  • Status changed from Assigned to Ready For Testing

The parameter :parent_id can be passed for PUT or POST.
It was missing from the API documentation and the following pull request fixes this
https://github.com/theforeman/foreman/pull/755

Actions #3

Updated by Ohad Levy over 11 years ago

  • Target version set to 1.2.0
Actions #4

Updated by Joseph Magen over 11 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100
Actions

Also available in: Atom PDF